# -*- coding: utf-8 -*-
""" 
@author: xingxingzaixian
@create: 2021/4/4
@description: 
"""
import redis
import uvicorn

from core.server import create_app
from core import settings

app = create_app()

if settings.REDIS:
    pool = redis.ConnectionPool(**settings.REDIS_CONFIG)
    r = redis.Redis(connection_pool=pool)


if __name__ == '__main__':
    # 输出所有的路由
    for route in app.routes:
        if hasattr(route, "methods"):
            print({'path': route.path, 'name': route.name, 'methods': route.methods})
    uvicorn.run(app='run:app', host='127.0.0.1', port=8000, reload=True)